package fpzhan.plane.program.test.school;

import java.util.ArrayList;
import java.util.List;

public class Query {

    public static List<Student> studentByTeacher(Teacher teacher){
        List<Student> students = new ArrayList<>();
        students.add(new Student("王"+teacher.getTeachderId()+"1",teacher.getTeachderId(), teacher.getGrade(),teacher.getClassNo(),true));
        students.add(new Student("王"+teacher.getTeachderId()+"2",teacher.getTeachderId(), teacher.getGrade(),teacher.getClassNo(),true));
        students.add(new Student("王"+teacher.getTeachderId()+"3",teacher.getTeachderId(), teacher.getGrade(),teacher.getClassNo(),false));
        return students;
    }

    public static List<Teacher> teacherByClass(AClass schoolClass){
        List<Teacher> teachers = new ArrayList<>();
        if("1".equals(schoolClass.getClassNo())){
            teachers.add(new Teacher("1"+schoolClass.getClassNo(),"张1"+schoolClass.getClassNo(),schoolClass.getGrade(),schoolClass.getClassNo()));
            teachers.add(new Teacher("2"+schoolClass.getClassNo(),"张2"+schoolClass.getClassNo(),schoolClass.getGrade(),schoolClass.getClassNo()));
            teachers.add(new Teacher("3"+schoolClass.getClassNo(),"张3"+schoolClass.getClassNo(),schoolClass.getGrade(),schoolClass.getClassNo()));
        }else {
            teachers.add(new Teacher("2"+schoolClass.getClassNo(),"李"+schoolClass.getClassNo(),schoolClass.getGrade(),schoolClass.getClassNo()));
            teachers.add(new Teacher("2"+schoolClass.getClassNo(),"李"+schoolClass.getClassNo(),schoolClass.getGrade(),schoolClass.getClassNo()));
            teachers.add(new Teacher("2"+schoolClass.getClassNo(),"李"+schoolClass.getClassNo(),schoolClass.getGrade(),schoolClass.getClassNo()));
        }

        return teachers;
    }

    public static AClass aClass(AClass schoolClass){
        if("1".equals(schoolClass.getGrade()) && "1".equals(schoolClass.getClassNo())){
            schoolClass.setClassName("一年级一班");
        }else{
            schoolClass.setClassName("一年级二班");
        }
        return schoolClass;
    }
}
